﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace PcCtrlUI
{
	/// <summary>
	/// Interaction logic for FanCtrl.xaml
	/// </summary>
	public partial class FanCtrl : UserControl
	{
        private double max;

		public FanCtrl()
		{
			this.InitializeComponent();
		}
		
		public void setName(string name)
		{
			this.name.Content = name;
		}
        public void setMax(double max)
        {
            this.max = max;
        }

        public void setValue(double value)
        {
            this.bar.Value = (value / max)*100.0;
            this.rpm.Content = value + " 1/min";
            this.currentValue.Content = Math.Round((value / max) * 100.0, 1) + "%";

        }

	}
}